<?php
class qStack
{
	private $stack = array();
	
	function __construct()
	{
	}
	
	public function Pop()
	{
	    return array_pop($this->stack);
	}
	
	public function Push($var)
	{
	    array_push($this->stack, $var);
	}
	
	public function Check()
	{
	    $var = $this->Pop();
	    $this->Push($var);
	    return $var;
	}
	
	public function IsEmpty()
	{
	    return array_keys($this->stack) == array();
	}
	
	public function Show()
	{
	    print_r($this->stack);
	}
	
	public function Clear()
	{
	    $this->stack = array();
	}
}